export interface Marker {
  id: number;
  name: string;
  lat: number;
  lng: number;
}

export function getMarkerList(): Promise<Marker[]> {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve([
        {
          id: 1,
          name: 'Marker 1',
          lat: 22.8524013961076,
          lng: 111.783727873893,
        }
      ])
    }, 1000)
  })
}

export function getPathList(): Promise<Marker[]> {
  return new Promise((resolve) => {
    setTimeout(() => {
      const startLat = 22.8524013961076;
      const startLng = 111.783727873893;
      const points = [];
      const step = 0.0001; // 每个点之间的步长
      const count = 50; // 生成50个点

      for (let i = 0; i < count; i++) {
        points.push({
          id: i + 1,
          name: `Point ${i + 1}`,
          lat: startLat + i * step,
          lng: startLng + i * step
        });
      }

      resolve(points);
    }, 1000)
  })
}

export interface HeatmapPoint {
  lng: number; // 经度
  lat: number; // 纬度
  weight: number; // 权重
}

export function getHeatmapData(): Promise<HeatmapPoint[]> {
  return new Promise((resolve) => {
    setTimeout(() => {
      const startLat = 22.8524013961076;
      const startLng = 111.783727873893;
      const points: HeatmapPoint[] = [];
      const step = 0.0001; // 每个点之间的步长
      const count = 50; // 生成50个点

      for (let i = 0; i < count; i++) {
        points.push({
          lat: startLat + i * step,
          lng: startLng + i * step,
          weight: Math.random()
        });
      }

      resolve(points);
    }, 1000)
  })
}